from tqsdk import TqApi, TqAuth, TqSim
from tqsdk.ta import MACD

api = TqApi(auth=TqAuth("15842676013@m.com", "482737900Wtxdy"))
klines = api.get_kline_serial("KQ.m@CZCE.OI", 24 * 60 * 60, data_length=5)
macd = MACD(klines, 12, 26, 9)
print(list(macd["diff"]))
print(list(macd["dea"]))
print(list(macd["bar"]))